package com.hariro.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.LinearLayout;
import android.widget.Toast;

import com.hariro.activity.StyleTestActivity;
import com.hariro.activity.StyleTestActivity_BMI;
import com.hariro.activity.StyleTestActivity_DressStyle;
import com.hariro.activity.StyleTestActivity_GirlLike;
import com.qianfeng.project.R;

public class My_Fragment extends Fragment implements OnClickListener {
	private Intent intent = null;

	@Override
	public void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);

	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.fragment_my, null);
		LinearLayout layout_collects = (LinearLayout) view
				.findViewById(R.id.layout_collects);
		LinearLayout layout_styletest = (LinearLayout) view
				.findViewById(R.id.layout_styletest);
		LinearLayout layout_BMItest = (LinearLayout) view
				.findViewById(R.id.layout_BMItest);
		LinearLayout layout_colortest = (LinearLayout) view
				.findViewById(R.id.layout_colortest);
		LinearLayout layout_userfeedback = (LinearLayout) view
				.findViewById(R.id.layout_userfeedback);
		LinearLayout layout_girllike = (LinearLayout) view
				.findViewById(R.id.layout_girllike);
		layout_collects.setOnClickListener(this);
		layout_styletest.setOnClickListener(this);
		layout_BMItest.setOnClickListener(this);
		layout_colortest.setOnClickListener(this);
		layout_userfeedback.setOnClickListener(this);
		layout_girllike.setOnClickListener(this);
		return view;
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.layout_collects:
			intent = new Intent(getActivity(), StyleTestActivity.class);
			Toast.makeText(getActivity(), "R.id.layout_collects", 0).show();
			break;
		case R.id.layout_styletest:
			intent = new Intent(getActivity(),
					StyleTestActivity_DressStyle.class);
			Toast.makeText(getActivity(), "R.id.layout_styletest", 0).show();
			break;
		case R.id.layout_BMItest:
			intent = new Intent(getActivity(), StyleTestActivity_BMI.class);
			Toast.makeText(getActivity(), "R.id.layout_BMItest", 0).show();
			break;
		case R.id.layout_colortest:
			intent = new Intent(getActivity(), StyleTestActivity.class);
			Toast.makeText(getActivity(), "R.id.layout_colortest", 0).show();
			break;
		case R.id.layout_userfeedback:
			intent = new Intent(getActivity(), StyleTestActivity.class);
			Toast.makeText(getActivity(), "R.id.layout_userfeedback", 0).show();
			break;
		case R.id.layout_girllike:
			intent = new Intent(getActivity(), StyleTestActivity_GirlLike.class);
			Toast.makeText(getActivity(), "R.id.layout_girllike", 0).show();
			break;
		default:
			break;
		}
		startActivity(intent);
	}
}
